<script setup lang="ts">
import type {optionsLabelType} from "@/options";
import {computed} from "vue";
interface Props {
  options: optionsLabelType[]
  value: number
}
const props = defineProps<Props>()
const label = computed(()=>{
  const item = props.options.find((item)=>{
    return item.value === props.value
  })
  if (item){
    return item.label
  }
  return props.value.toString()
})
const color = computed(()=>{
  const item = props.options.find((item)=>{
    return item.value === props.value
  })
  if (item){
    return item.color
  }
  return ""
})
</script>
<template>
  <a-tag :color="color">{{ label }}</a-tag>
</template>
<style scoped lang="less">
</style>